package com.gome.spiderkit.task.base;

import java.util.Date;

import org.quartz.Trigger;
import org.quartz.TriggerBuilder;


public class TriggerStartNow extends TriggerConfig{
	private String name = "start-now";
	private String group = "once";
	
	public TriggerStartNow() {
		this.setTriggerName(name);
		this.setTrggerGroup(group);
	}
	
	public void setName(String name) {
		this.name = name;
		this.setTriggerName(name);
	}
	
	public void setGroup(String group) {
		this.group = group;
		this.setTrggerGroup(group);
	}
	
	public Trigger getTigger() {
		Date now = new Date();
		Trigger trigger = TriggerBuilder.newTrigger().withIdentity(this.getTriggerName(), this.getTrggerGroup()).startAt(now).build();
		return trigger;
	}
}
